package metronome;

import java.io.IOException;
import java.util.TimerTask;

import javax.sound.sampled.LineUnavailableException;
/**
 * Update the time of metronome.
 * @author Suwijak Suppapit 5510546204
 * @version 5/1/2013
 */
public class MetronomeTask extends TimerTask{

	Metronome metronome;
	/**
	 * Initialize MetronomeTask.
	 * @param metronome metronome
	 */
	public MetronomeTask(Metronome metronome){
		this.metronome = metronome;
	}
	
	@Override
	public void run() {

		try {
			metronome.beep();
		} catch (LineUnavailableException | IOException e) {
			e.printStackTrace();
		}
	}

}
